package top.chenyaohua.asm;


import java.util.List;
import java.util.Map;

public class MethodMetadata {

    /**
     * 方法名
     */
    private String name;

    /**
     * 方法上的注解
     */
    private List<AnnotationMetadata> annotations;
    /**
     * 方法参数
     */
    private Map<Integer, FieldMetadata> params;

    /**
     * 方法异常类型
     */
    private String[] exceptions;
    /**
     * 注解元数据中方法的默认值
     */
    private Object annotationDefault;

    private String returnType;
    /**
     * 方法参数个数
     */
    private Integer count;

    /**
     * 是否final修饰方法
     */
    private boolean accFinal;
    /**
     * 是否静态
     */
    private boolean accStatic;
    /**
     * 是否抽象方法
     */
    private boolean accAbstract;
    /**
     * 是否同步方法
     */
    private boolean accSynchronized;
    /**
     *
     * 封装权限
     */
    private int accEncapsulation;

    public MethodMetadata (String name, boolean accStatic, String[] exceptions, String returnType, Integer count) {
        this.name = name;
        this.accStatic = accStatic;
        this.exceptions = exceptions;
        this.returnType = returnType;
        this.count = count;
    }

    public String getName () {
        return name;
    }

    protected void setName (String name) {
        this.name = name;
    }



    public List<AnnotationMetadata> getAnnotations () {
        return annotations;
    }

    protected void setAnnotations (List<AnnotationMetadata> annotations) {
        this.annotations = annotations;
    }



    public String[] getExceptions () {
        return exceptions;
    }

    protected void setExceptions (String[] exceptions) {
        this.exceptions = exceptions;
    }

    protected void setParams (Map<Integer, FieldMetadata> params) {
        this.params = params;
    }

    public Map<Integer, FieldMetadata> getParams () {
        return params;
    }

    public Object getAnnotationDefault () {
        return annotationDefault;
    }

    protected void setAnnotationDefault (Object annotationDefault) {
        this.annotationDefault = annotationDefault;
    }

    public String getReturnType () {
        return returnType;
    }

    protected void setReturnType (String returnType) {
        this.returnType = returnType;
    }

    public Integer getCount () {
        return count;
    }

    protected void setCount (Integer count) {
        this.count = count;
    }

    public boolean isAccFinal () {
        return accFinal;
    }

    protected void setAccFinal (boolean accFinal) {
        this.accFinal = accFinal;
    }

    public boolean isAccStatic () {
        return accStatic;
    }

    protected void setAccStatic (boolean accStatic) {
        this.accStatic = accStatic;
    }

    public boolean isAccAbstract () {
        return accAbstract;
    }

    protected void setAccAbstract (boolean accAbstract) {
        this.accAbstract = accAbstract;
    }

    public boolean isAccSynchronized () {
        return accSynchronized;
    }

    protected void setAccSynchronized (boolean accSynchronized) {
        this.accSynchronized = accSynchronized;
    }

    public int getAccEncapsulation () {
        return accEncapsulation;
    }

    protected void setAccEncapsulation (int accEncapsulation) {
        this.accEncapsulation = accEncapsulation;
    }

}
